import request from '@u/request'
import { HttpMethod } from '@u/http'

// 先查询近6个月的月份的收入统计
export function getMonthlyIncome() {
  return request({
    url: '/beauty/statistical/monthlyIncome',
    method: HttpMethod.GET
  })
}

// 先查询近6个月的月份的退费统计
export function getMonthlyRefund() {
  return request({
    url: '/beauty/statistical/monthlyRefund',
    method: HttpMethod.GET
  })
}

// 人数统计
export function getPeopleNumber() {
  return request({
    url: '/beauty/statistical/peopleNumber',
    method: HttpMethod.GET
  })
}

// 统计客户的 总消费金额(不包含退费的),退费金额
export function getMemberConsumption(memberId) {
  return request({
    url: `/beauty/statistical/memberConsumption/${memberId}`,
    method: HttpMethod.GET
  })
}

// 统计客户的充值次数,退费次数
export function getConsumptionCount(memberId) {
  return request({
    url: `/beauty/statistical/consumptionCount/${memberId}`,
    method: HttpMethod.GET
  })
}

// 统计客户的支付宝使用次数,现金使用次数
export function getPaymentCount(memberId) {
  return request({
    url: `/beauty/statistical/paymentCount/${memberId}`,
    method: HttpMethod.GET
  })
}

// 统计消费榜前10
export function getTopTenSpenders(memberId) {
  return request({
    url: `/beauty/statistical/topTenSpenders`,
    method: HttpMethod.GET
  })
}

/**
 * 订单统计
 * 根据客户id查询出当前每个订单状态下面的数量
 * 订单状态(0:待付款 1:待确认 2:待评价 3:已完成 4:无效订单 5已关闭
 */
export function statisticMemberOrder(memberId) {
  return request({
    url: `/beauty/statistical/statisticMemberOrder/${memberId}`,
    method: HttpMethod.GET
  })
}

// 根据客户id查询出当前客户的最近6月份的充值情况
export function statisticMemberTopUp(memberId) {
  return request({
    url: `/beauty/statistical/statisticMemberTopUp/${memberId}`,
    method: HttpMethod.GET
  })
}

// 客户月统计订单
export function statisticMemberMonthOrder(memberId) {
  return request({
    url: `/beauty/statistical/statisticMemberMonthOrder/${memberId}`,
    method: HttpMethod.GET
  })
}
